#!/tmp/venv1/venv1/bin/python3
# -*- coding: UTF-8 -*-
import pymysql
create_table = "CREATE TABLE IF NOT EXISTS `runoob_tbl`( \
   `runoob_id` INT UNSIGNED AUTO_INCREMENT, \
   `runoob_title` VARCHAR(100) NOT NULL, \
   `runoob_author` VARCHAR(40) NOT NULL, \
   `submission_date` DATE, \
   PRIMARY KEY ( `runoob_id` ) \
)ENGINE=InnoDB DEFAULT CHARSET=utf8;"

db = pymysql.connect("localhost", "root", "123456", "python_practice")
cursor = db.cursor()
cursor.execute("select version()")
data = cursor.fetchone()
print("Database Version: %s ", data)
create_result = cursor.execute(create_table)
print(create_result)

db.close()
